/*
 *  PlayerList.cpp
 *  SquirrelAdven
 *
 *  Created by Wen Xu on 3/14/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include "PlayerList.h"

PlayerList::PlayerList(int numPlayer) {
	this->numPlayer = numPlayer;
	int i;
	for (i = 0; i < numPlayer; i++) {
		Player p;
		p.setPlayerID(i);
		p.setObjFilename("player.obj");
		p.setWmtfFilename("fur5.wmtf");
		playerList.push_back(p);
	}
}

PlayerList::~PlayerList() {
}

vector<Player> PlayerList::getPlayerList() {
	return playerList;
}

Player * PlayerList::getPlayerByID(int id) {
	int i;
	for (i = 0; i < playerList.size(); i++) {
		if (playerList[i].getPlayerID() == id) {
			return &playerList[i];
		}
	}
	return NULL;
}

void PlayerList::addPlayer(Player p) {
	playerList.push_back(p);
}